import { BasicColumn, FormSchema } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '目标字段名称',
    dataIndex: 'targetFieldName',
    width: 200,
  },
  {
    title: '目标字段编码',
    dataIndex: 'targetFieldCode',
    width: 200,
  },
  {
    title: '源字段名称',
    dataIndex: 'sourceFieldName',
    width: 200,
  },
  {
    title: '源字段编码',
    dataIndex: 'sourceFieldCode',
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'sourceFieldId',
    label: '源字段',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'targetFieldId',
    label: '目标字段',
    component: 'Input',
    colProps: { span: 8 },
  },
  /*{
    field: 'sourceId',
    label: '源Id',
    component: 'Input',
    ifShow: false,
  },
  {
    field: 'targetId',
    label: '源Id',
    component: 'Input',
    ifShow: false,
  },*/
];

export const formSchema: FormSchema[] = [
  {
    field: 'reflectionId',
    label: '关联id',
    component: 'Input',
    ifShow: false,
  },
  {
    field: 'sourceFieldId',
    label: '源字段',
    required: true,
    component: 'Select',
    componentProps: {
      showSearch: true,
      filterOption: (input: string, option: any) => {
        return option.label.includes(input);
      },
    },
  },
  {
    field: 'targetFieldId',
    label: '目标字段',
    required: true,
    component: 'Select',
    componentProps: {
      showSearch: true,
      filterOption: (input: string, option: any) => {
        return option.label.includes(input);
      },
    },
  },
  {
    field: 'scriptId',
    label: '转换脚本',
    component: 'Select',
    componentProps: {
      showSearch: true,
      filterOption: (input: string, option: any) => {
        return option.label.includes(input);
      },
    },
  },
];
